//
//  DistanceCell.m
//  WGFGlobalHouses
//
//  Created by waiguofang on 15/5/8.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//

#import "DistanceCell.h"
#import "distanceView.h"
#import "disDescModel.h"

@interface DistanceCell()
//保存传过来的距离arr
@property(nonatomic,strong)NSArray *array;
@end
@implementation DistanceCell

+(instancetype)cellWithTable:(UITableView *)tableView withDisDescArr:(NSArray *)arr;
{
    DistanceCell *cell = [[[NSBundle mainBundle]loadNibNamed:@"DistanceCells" owner:nil options:nil]lastObject];
        
        if (arr.count  != 0 && arr != nil)
        {
            for (NSInteger i = 0; i < arr.count; i ++)
            {
                distanceView *view = [distanceView distanceViewInitWithXib:nil];
                view.model = [arr objectAtIndex:i];
                view.frame = CGRectMake(0, 43 + 35*i, UIScreenWidth,35);
                [cell.contentView addSubview:view];
            }

        }
     [cell  setSelectionStyle:UITableViewCellSelectionStyleNone];
    return cell;
}


+(CGFloat)getHeightWithTable:(UITableView *)tableView withDisDescArr:(NSArray *)arr
{
    
    if (arr.count  != 0 && arr != nil)
    {
        return 43 + 35*arr.count;

    }
    return 43;
    
}

@end
